﻿using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Pyramid.Hardware;
using Pyramid.Hardware.Operations;
using Pyramid.IO;
using Pyramid.Hardware.Interop;

namespace Pyramid.Tests
{
    [TestClass]
    public class NotOperationFixture
    {
        [TestMethod]
        public void ShouldPerformNotOperationInTwoTicks()
        {
            var input = FixedInputLine.CreateBus(-6, Tryte.TritsPerTryte).Cast<ILine>();
            var nullInput = FixedInputLine.CreateBus(0, Tryte.TritsPerTryte).Cast<ILine>();
            Tryte expectedResult = 6;

            var clock = new ManualClock();
            var testOperation = new NotOperation(input, nullInput);
            var outputBus = new OutputBus(testOperation.OutputBus);

            Assert.AreEqual(expectedResult, outputBus.Value.ToTryte());
        }

    }
}